package com.yupi.yuoj.mapper;

import com.yupi.yuoj.model.entity.Question;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yupi.yuoj.model.entity.QuestionComment;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 李鱼皮
* @description 针对表【question(题目)】的数据库操作Mapper
* @createDate 2023-08-07 20:58:00
* @Entity com.yupi.yuoj.model.entity.Question
*/
public interface QuestionMapper extends BaseMapper<Question> {

    @Select("select * from question_comment where questionId=#{id}")
    List<QuestionComment> getCommentById(long id);

    @Select("select answer from question where id=#{id}")
    String getAnswerById(long id);
}




